package com.jrx.anytxn.reporting.job.xib.step;

import com.jrx.anytxn.accounting.entity.GaVoucherInfo;
import com.jrx.anytxn.reporting.entity.CmInteCoAcctntEntryDtl;
import com.jrx.anytxn.reporting.service.IXibService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AcctntProcessor implements ItemProcessor<GaVoucherInfo, CmInteCoAcctntEntryDtl> {

    @Autowired
    private IXibService xibService;

    private static final Logger logger = LoggerFactory.getLogger(AcctntProcessor.class);

    @Override
    public CmInteCoAcctntEntryDtl process(GaVoucherInfo item) throws Exception {
        try {
            return xibService.assemAcctntDtl(item);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("generateAcctntJob 出错了：{}", e.getMessage());
        }
        return null;
    }
}
